﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Root.master" AutoEventWireup="true" CodeFile="orderspec.aspx.cs" Inherits="orderspec" %>

<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxFormLayout" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">
    <script src="../Scripts/toolbar.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        // <![CDATA[
        function onMenuClick(s, e) {
            switch (e.item.index) {
                case 4:
                    e.item.NavigateUrl = '~/rep/orderRep.aspx?code=';
                    break;
                default: MenuItemClick(e, grid);
            }
        }
        // ]]>
    </script>
    <div class="pageLabel">
        <dx:ASPxLabel ID="lbl_page" runat="server" Text="Спецификация накладной" Font-Size="Medium" Theme="iOS">
        </dx:ASPxLabel>
    </div>
    <div style="float: left; margin-left: 10px;">
        <dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" Width="200px">
            <Items>
                <dx:LayoutGroup Caption="Layout Group" ShowCaption="False">
                    <Items>
                        <dx:LayoutGroup Caption="Layout Group" ColCount="2" ShowCaption="False">
                            <Items>
                                <dx:LayoutItem Caption="Код">
                                    <LayoutItemNestedControlCollection>
                                        <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                            <dx:ASPxTextBox ID="txtCODE" runat="server" Width="170px" ReadOnly="True">
                                            </dx:ASPxTextBox>
                                        </dx:LayoutItemNestedControlContainer>
                                    </LayoutItemNestedControlCollection>
                                </dx:LayoutItem>
                                <dx:LayoutItem Caption="Дата">
                                    <LayoutItemNestedControlCollection>
                                        <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                            <dx:ASPxTextBox ID="txtDATA" runat="server" Width="170px"  ReadOnly="True">
                                            </dx:ASPxTextBox>
                                        </dx:LayoutItemNestedControlContainer>
                                    </LayoutItemNestedControlCollection>
                                </dx:LayoutItem>
                                <dx:LayoutItem Caption="Создал">
                                    <LayoutItemNestedControlCollection>
                                        <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                            <dx:ASPxTextBox ID="txtOPERATOR" runat="server" Width="170px"  ReadOnly="True">
                                            </dx:ASPxTextBox>
                                        </dx:LayoutItemNestedControlContainer>
                                    </LayoutItemNestedControlCollection>
                                </dx:LayoutItem>
                                <dx:LayoutItem Caption="Получил">
                                    <LayoutItemNestedControlCollection>
                                        <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                            <dx:ASPxTextBox ID="txtWORKER" runat="server" Width="170px"  ReadOnly="True">
                                            </dx:ASPxTextBox>
                                        </dx:LayoutItemNestedControlContainer>
                                    </LayoutItemNestedControlCollection>
                                </dx:LayoutItem>
                                <dx:LayoutItem Caption="Тип операции">
                                    <LayoutItemNestedControlCollection>
                                        <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                            <dx:ASPxTextBox ID="txtOPERTYPE" runat="server" Width="170px"  ReadOnly="True">
                                            </dx:ASPxTextBox>
                                        </dx:LayoutItemNestedControlContainer>
                                    </LayoutItemNestedControlCollection>
                                </dx:LayoutItem>
                                <dx:LayoutItem Caption="Объект">
                                    <LayoutItemNestedControlCollection>
                                        <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                            <dx:ASPxTextBox ID="txtARCOBJECT" runat="server" Width="170px"  ReadOnly="True">
                                            </dx:ASPxTextBox>
                                        </dx:LayoutItemNestedControlContainer>
                                    </LayoutItemNestedControlCollection>
                                </dx:LayoutItem>
                            </Items>
                        </dx:LayoutGroup>
                        <dx:LayoutItem Caption="Статус">
                            <LayoutItemNestedControlCollection>
                                <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                    <dx:ASPxTextBox ID="txtSTATE" runat="server" Width="100%"  ReadOnly="True">
                                    </dx:ASPxTextBox>
                                </dx:LayoutItemNestedControlContainer>
                            </LayoutItemNestedControlCollection>
                        </dx:LayoutItem>
                        <dx:LayoutItem Caption="Примечание" Width="100%">
                            <LayoutItemNestedControlCollection>
                                <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                    <dx:ASPxTextBox ID="txtNOTE" runat="server" Width="100%"  ReadOnly="True">
                                    </dx:ASPxTextBox>
                                </dx:LayoutItemNestedControlContainer>
                            </LayoutItemNestedControlCollection>
                        </dx:LayoutItem>
                    </Items>
                </dx:LayoutGroup>
            </Items>
        </dx:ASPxFormLayout>
        <dx:ASPxMenu ID="mMenu" runat="server" EnableViewState="False" EncodeHtml="False" SeparatorWidth="2px" BackColor="Transparent"
            SeparatorHeight="15px" ItemSpacing="1px">
            <SeparatorBackgroundImage ImageUrl="~\Images\shared\ToolBars\Office2003\SeparatorBackground.png" />
            <ClientSideEvents ItemClick="function(s, e) { onMenuClick(s, e); }" />
            <Items>
                <dx:MenuItem Name="btn_Insert" Text="" ToolTip="Добавить запись" GroupName="grp_edit" BeginGroup="True">
                    <Image Url="~/Images/shared/edit_add.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_edit" Name="btn_edit" Text="" ToolTip="Редактировать запись">
                    <Image Url="~/Images/shared/edit.png" UrlDisabled="~/Images/shared/edit_disable.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_edit" Name="btn_Delete" Text="" ToolTip="Удалит запись">
                    <Image Url="~/Images/shared/editdelete.png" UrlDisabled="~/Images/shared/editdelete_disable.png">
                    </Image>
                </dx:MenuItem>
            </Items>
        </dx:ASPxMenu>
        <dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" AutoGenerateColumns="False" KeyFieldName="CODE" DataSourceID="ds_OrderSpec"
            OnCellEditorInitialize="grd_OrderSpec_CellEditorInitialize"
            OnRowDeleting="grd_OrderSpec_RowDeleting"
            OnInitNewRow="grd_OrderSpec_InitNewRow"
            OnStartRowEditing="grd_OrderSpec_StartRowEditing"
            OnRowInserting="grd_OrderSpec_RowInserting"
            OnRowInserted="grd_OrderSpec_RowInserted"
            OnHtmlDataCellPrepared="grd_OrderSpec_HtmlDataCellPrepared">
            <Columns>
                <dx:GridViewDataTextColumn Caption="Код" FieldName="CODE" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="0" Width="40px">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="код документа" FieldName="ORDERDOC" ShowInCustomizationForm="True" Visible="False" VisibleIndex="1">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Caption="Папка" FieldName="ARCPLACE" ShowInCustomizationForm="True" VisibleIndex="4" Width="100px">
                    <PropertiesComboBox DataSourceID="ds_arkLookUp" TextField="STRCODE" ValueField="CODE" ValueType="System.Int32" EnableCallbackMode="True" IncrementalFilteringMode="StartsWith">
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataTextColumn Caption="Объект" Name="ARCOBJECT" ShowInCustomizationForm="True" VisibleIndex="2" Width="180px">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Помещение" Name="ARCROOM" ShowInCustomizationForm="True" VisibleIndex="3" Width="180px">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
            </Columns>
            <SettingsBehavior AllowFocusedRow="True" ConfirmDelete="True" EnableCustomizationWindow="true" AllowSelectByRowClick="True" AllowSelectSingleRowOnly="True" />
            <SettingsPager AlwaysShowPager="True">
                <PageSizeItemSettings Visible="True">
                </PageSizeItemSettings>
            </SettingsPager>

            <Settings ShowFooter="True" />
            <SettingsLoadingPanel Mode="Disabled" />
        </dx:ASPxGridView>
    </div>
    <asp:EntityDataSource ID="ds_OrderSpec" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="ORDERSPEC" AutoGenerateWhereClause="True" Where="" EntityTypeFilter="" Select="">
        <WhereParameters>
            <asp:QueryStringParameter DbType="Int32" DefaultValue="0" Name="ORDERDOC" QueryStringField="id" />
        </WhereParameters>
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="ds_arkLookUp" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableFlattening="False" EntitySetName="ARCPLACE" Select="it.[CODE], it.[STRCODE]">
    </asp:EntityDataSource>
</asp:Content>

